import request from '@/utils/request'
import variable from '@/utils/variables'
const baseURL = variable.URL.baseURL

// 申请开通云工厂模板
export function openCloudFactory(params) {
	return request({
	    baseURL: baseURL,
	    url: '/factory/frontend/apply/insert',
	    method: 'post',
	    data: params
	})
}

/**
 * 高德地图
 */
// 地理逆编码 通过经纬度获得结构化地址信息
export function locationAddress(query) {
  return request({
    baseURL: baseURL,
    url: '/logistics/area/location_address',
    method: 'GET',
    params: query
  })
}
// 地理编码 根据结构化地址信息获得经纬度坐标
export function locationLogistics(query) {
  return request({
    baseURL: baseURL,
    url: '/logistics/area/address_location',
    method: 'GET',
    params: query
  })
}

// 分类组件的
export function CategoryList(tradeId) {
  return request({
    baseURL: baseURL,
    url: '/category/operate/list',
    method: 'get',
    params: {
    	tradeId: tradeId
    }
  })
}

/**
 * 快递部分
 */
 // 物流公司列表
 export function getCompanyList(query) {
   return request({
     baseURL: baseURL,
     url: '/logistics/company/list',
     method: 'get',
     params: query
   })
 }
 // 获取订单物流信息
 export function getContextList(query) {
	 return request({
		 baseURL: baseURL,
		 url: '/logistics/context/list',
		 method: 'get',
		 params: query
	 })
 }

 // 判断类目是否是子节点
 export function CategoryIsleaf(id) {
   return request({
     baseURL: baseURL,
     url: '/category/isleaf',
     method: 'get',
     params: {
     	id: id
     }
   })
 }

//修改负责人旧手机号 发送验证码
 export function getMessageVcode(params) {
 	return request({
 	    baseURL: baseURL,
 	    url: '/member/send_code',
 	    method: 'POST',
       params: params
 	})
 }

 // 修改手机号码接口
 export function getCheckCode(params) {
 	return request({
 	    baseURL: baseURL,
 	    url: '/member/validate_mobile',
 	    method: 'POST',
       params: params
 	})
 }

 // 修改新手机号码 发送验证码
 export function getNewMessageVcode(params) {
 	return request({
 	    baseURL: baseURL,
 	    url: '/member/send_code',
 	    method: 'POST',
       params: params
 	})
 }

 // 修改新手机号码
 export function getNewCheckCode(params) {
	 return request({
			 baseURL: baseURL,
			 url: '/member/reset_user_phone',
			 method: 'PUT',
			 params: params
	 })
 }
